<?php
/**
 * Created by PhpStorm.
 * User: caijianling
 * Date: 2018/8/20
 * Time: 上午11:14
 */

require_once 'admin-header.php';
$set_array = $ff->config_variable_get('./admin-core/config.php', 'config_index_set');


?>
    <body data-type="widgets">
    <script src="assets/js/theme.js"></script>
    <div class="am-g tpl-g">
        <!-- 头部 -->
        <header>
            <!-- logo -->
            <div class="am-fl tpl-header-logo">
                <a href="javascript:;"><img src="assets/img/logo.png" alt=""></a>
            </div>
            <!-- 右侧内容 -->
            <div class="tpl-header-fluid">
                <!-- 侧边切换 -->
                <div class="am-fl tpl-header-switch-button am-icon-list">
                    <span>

                </span>
                </div>
                <!-- 搜索 -->
                <div class="am-fl tpl-header-search">
                    <form class="tpl-header-search-form" action="javascript:;">
                        <button class="tpl-header-search-btn am-icon-search"></button>
                        <input class="tpl-header-search-box" type="text" placeholder="搜索内容...">
                    </form>
                </div>
                <!-- 其它功能-->
                <div class="am-fr tpl-header-navbar">
                    <ul>
                        <!-- 欢迎语 -->
                        <li class="am-text-sm tpl-header-navbar-welcome">
                            <a href="javascript:;">欢迎你, <span>Amaze UI</span> </a>
                        </li>

                        <!-- 新邮件 -->
                        <li class="am-dropdown tpl-dropdown" data-am-dropdown>
                            <a href="javascript:;" class="am-dropdown-toggle tpl-dropdown-toggle"
                               data-am-dropdown-toggle>
                                <i class="am-icon-envelope"></i>
                                <span class="am-badge am-badge-success am-round item-feed-badge">4</span>
                            </a>
                            <!-- 弹出列表 -->
                            <ul class="am-dropdown-content tpl-dropdown-content">
                                <li class="tpl-dropdown-menu-messages">
                                    <a href="javascript:;" class="tpl-dropdown-menu-messages-item am-cf">
                                        <div class="menu-messages-ico">
                                            <img src="assets/img/user04.png" alt="">
                                        </div>
                                        <div class="menu-messages-time">
                                            3小时前
                                        </div>
                                        <div class="menu-messages-content">
                                            <div class="menu-messages-content-title">
                                                <i class="am-icon-circle-o am-text-success"></i>
                                                <span>夕风色</span>
                                            </div>
                                            <div class="am-text-truncate"> Amaze UI 的诞生，依托于 GitHub 及其他技术社区上一些优秀的资源；Amaze
                                                UI 的成长，则离不开用户的支持。
                                            </div>
                                            <div class="menu-messages-content-time">2016-09-21 下午 16:40</div>
                                        </div>
                                    </a>
                                </li>

                                <li class="tpl-dropdown-menu-messages">
                                    <a href="javascript:;" class="tpl-dropdown-menu-messages-item am-cf">
                                        <div class="menu-messages-ico">
                                            <img src="assets/img/user02.png" alt="">
                                        </div>
                                        <div class="menu-messages-time">
                                            5天前
                                        </div>
                                        <div class="menu-messages-content">
                                            <div class="menu-messages-content-title">
                                                <i class="am-icon-circle-o am-text-warning"></i>
                                                <span>禁言小张</span>
                                            </div>
                                            <div class="am-text-truncate"> 为了能最准确的传达所描述的问题， 建议你在反馈时附上演示，方便我们理解。</div>
                                            <div class="menu-messages-content-time">2016-09-16 上午 09:23</div>
                                        </div>
                                    </a>
                                </li>
                                <li class="tpl-dropdown-menu-messages">
                                    <a href="javascript:;" class="tpl-dropdown-menu-messages-item am-cf">
                                        <i class="am-icon-circle-o"></i> 进入列表…
                                    </a>
                                </li>
                            </ul>
                        </li>

                        <!-- 新提示 -->
                        <li class="am-dropdown" data-am-dropdown>
                            <a href="javascript:;" class="am-dropdown-toggle" data-am-dropdown-toggle>
                                <i class="am-icon-bell"></i>
                                <span class="am-badge am-badge-warning am-round item-feed-badge">5</span>
                            </a>

                            <!-- 弹出列表 -->
                            <ul class="am-dropdown-content tpl-dropdown-content">
                                <li class="tpl-dropdown-menu-notifications">
                                    <a href="javascript:;" class="tpl-dropdown-menu-notifications-item am-cf">
                                        <div class="tpl-dropdown-menu-notifications-title">
                                            <i class="am-icon-line-chart"></i>
                                            <span> 有6笔新的销售订单</span>
                                        </div>
                                        <div class="tpl-dropdown-menu-notifications-time">
                                            12分钟前
                                        </div>
                                    </a>
                                </li>
                                <li class="tpl-dropdown-menu-notifications">
                                    <a href="javascript:;" class="tpl-dropdown-menu-notifications-item am-cf">
                                        <div class="tpl-dropdown-menu-notifications-title">
                                            <i class="am-icon-star"></i>
                                            <span> 有3个来自人事部的消息</span>
                                        </div>
                                        <div class="tpl-dropdown-menu-notifications-time">
                                            30分钟前
                                        </div>
                                    </a>
                                </li>
                                <li class="tpl-dropdown-menu-notifications">
                                    <a href="javascript:;" class="tpl-dropdown-menu-notifications-item am-cf">
                                        <div class="tpl-dropdown-menu-notifications-title">
                                            <i class="am-icon-folder-o"></i>
                                            <span> 上午开会记录存档</span>
                                        </div>
                                        <div class="tpl-dropdown-menu-notifications-time">
                                            1天前
                                        </div>
                                    </a>
                                </li>


                                <li class="tpl-dropdown-menu-notifications">
                                    <a href="javascript:;" class="tpl-dropdown-menu-notifications-item am-cf">
                                        <i class="am-icon-bell"></i> 进入列表…
                                    </a>
                                </li>
                            </ul>
                        </li>

                        <!-- 退出 -->
                        <li class="am-text-sm">
                            <a href="javascript:;">
                                <span class="am-icon-sign-out"></span> 退出
                            </a>
                        </li>
                    </ul>
                </div>
            </div>

        </header>
        <!-- 风格切换 -->
        <div class="tpl-skiner">
            <div class="tpl-skiner-toggle am-icon-cog">
            </div>
            <div class="tpl-skiner-content">
                <div class="tpl-skiner-content-title">
                    选择主题
                </div>
                <div class="tpl-skiner-content-bar">
                    <span class="skiner-color skiner-white" data-color="theme-white"></span>
                    <span class="skiner-color skiner-black" data-color="theme-black"></span>
                </div>
            </div>
        </div>
        <!-- 侧边导航栏 -->
        <div class="left-sidebar">
            <!-- 用户信息 -->
            <div class="tpl-sidebar-user-panel">
                <div class="tpl-user-panel-slide-toggleable">
                    <div class="tpl-user-panel-profile-picture">
                        <img src="assets/img/user04.png" alt="">
                    </div>
                    <span class="user-panel-logged-in-text">
              <i class="am-icon-circle-o am-text-success tpl-user-panel-status-icon"></i>
              禁言小张
          </span>
                    <a href="javascript:;" class="tpl-user-panel-action-link"> <span class="am-icon-pencil"></span> 账号设置</a>
                </div>
            </div>

            <!-- 菜单 -->
            <ul class="sidebar-nav">
                <li class="sidebar-nav-heading">Components <span class="sidebar-nav-heading-info"> 附加组件</span></li>
                <li class="sidebar-nav-link">
                    <a href="index.php" class="active">
                        <i class="am-icon-home sidebar-nav-link-logo"></i> 网站设置
                    </a>
                </li>

                <li class="sidebar-nav-heading">Page<span class="sidebar-nav-heading-info"> 常用页面</span></li>
                <li class="sidebar-nav-link">
                    <a href="javascript:;" class="sidebar-nav-sub-title">
                        <i class="am-icon-table sidebar-nav-link-logo"></i> 数据列表
                        <span class="am-icon-chevron-down am-fr am-margin-right-sm sidebar-nav-sub-ico"></span>
                    </a>
                    <ul class="sidebar-nav sidebar-nav-sub">
                        <li class="sidebar-nav-link">
                            <a href="table-list.php">
                                <span class="am-icon-angle-right sidebar-nav-link-logo"></span> 文字列表
                            </a>
                        </li>

                        <li class="sidebar-nav-link">
                            <a href="table-list-img.php">
                                <span class="am-icon-angle-right sidebar-nav-link-logo"></span> 图文列表
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="sidebar-nav-link">
                    <a href="sign-up.php">
                        <i class="am-icon-clone sidebar-nav-link-logo"></i> 注册
                        <span class="am-badge am-badge-secondary sidebar-nav-link-logo-ico am-round am-fr am-margin-right-sm">6</span>
                    </a>
                </li>
                <li class="sidebar-nav-link">
                    <a href="login.php">
                        <i class="am-icon-key sidebar-nav-link-logo"></i> 登录
                    </a>
                </li>
                <li class="sidebar-nav-link">
                    <a href="404.php">
                        <i class="am-icon-tv sidebar-nav-link-logo"></i> 404错误
                    </a>
                </li>

            </ul>
        </div>

        <!-- 内容区域 -->
        <div class="tpl-content-wrapper">

            <div class="container-fluid am-cf">
                <div class="row">
                    <div class="am-u-sm-12 am-u-md-12 am-u-lg-9">
                        <div class="page-header-heading"><span class="am-icon-home page-header-heading-icon"></span> 表单
                            <small>Amaze UI</small>
                        </div>
                        <p class="page-header-description">Amaze UI 有许多不同的表格可用。</p>
                    </div>
                    <div class="am-u-lg-3 tpl-index-settings-button">
                        <button type="button" class="page-header-button"><span class="am-icon-paint-brush"></span> 设置
                        </button>
                    </div>
                </div>

            </div>

            <div class="row-content am-cf">

                <div class="row">

                    <div class="am-u-sm-12 am-u-md-12 am-u-lg-6">
                        <div class="widget am-cf">
                            <div class="widget-head am-cf">
                                <div class="widget-title  am-cf">首页轮播图设置</div>


                            </div>
                            <div class="widget-body  am-fr">

                                <div class="am-u-sm-12 am-u-md-6 am-u-lg-6">
                                    <div class="am-form-group">
                                        <div class="am-btn-toolbar">
                                            <div class="am-btn-group am-btn-group-xs">
                                                <button type="button" class="am-btn am-btn-default am-btn-success"
                                                        onclick="window.location.href= './add-swipe.php'">
                                                    <span class="am-icon-plus"></span> 新增
                                                </button>
                                                <button type="button" class="am-btn am-btn-default am-btn-secondary">
                                                    <span class="am-icon-save"></span> 保存
                                                </button>
                                                <button type="button" class="am-btn am-btn-default am-btn-danger"><span
                                                            class="am-icon-trash-o"></span> 删除
                                                </button>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="am-u-sm-12 am-u-md-12 am-u-lg-6">
                                    <div class="am-input-group am-input-group-sm tpl-form-border-form cl-p">
                                        <input type="text" class="am-form-field ">
                                        <span class="am-input-group-btn">
            <button class="am-btn  am-btn-default am-btn-success tpl-table-list-field am-icon-search"
                    type="button"></button>
          </span>
                                    </div>
                                </div>

                                <div class="am-u-sm-12 widget-body  widget-body-lg am-fr">
                                    <table width="100%"
                                           class="am-table am-table-compact am-table-bordered am-table-radius am-table-striped tpl-table-black am-table-hover table-main"
                                           id="example-r">
                                        <thead>
                                        <tr>
                                            <th class="table-check"><input class="checkbox-all" type="checkbox"></th>
                                            <th class="table-id am-hide-sm-only">ID</th>
                                            <th class="table-img">图片</th>
                                            <th class="table-title">标题</th>
                                            <th class="table-content">内容</th>
                                            <th class="table-url am-hide-sm-only">链接</th>
                                            <th class="table-author am-hide-sm-only">作者</th>
                                            <th class="table-date am-hide-sm-only">修改日期</th>
                                            <th class="table-set">操作</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <?php
                                        $about_res_array = $admin_sql->index_swipe_select(1, 10);
                                        if ($about_res_array['status'] === 1 || $about_res_array['num'] === 0) goto C;
                                        $about_assoc = $about_res_array['array'];
                                        for ($i = 0; $i < $about_res_array['num']; $i++) {
                                            if (($i + 1) % 2 == 1) {
                                                ?>
                                                <tr class="gradeX">
                                                    <td class="am-text-middle">
                                                        <input type="checkbox">
                                                    </td>
                                                    <td class="am-text-middle am-hide-sm-only"><?= $about_assoc[$i]['id'] ?></td>
                                                    <td class="am-text-middle">
                                                        <img src="<?= $about_assoc[$i]['image'] ?>"
                                                             class="tpl-table-line-img"
                                                             alt="">
                                                    </td>
                                                    <td class="am-text-middle"><?= $about_assoc[$i]['title'] ?></td>
                                                    <td class="am-text-middle"><?= mb_substr($about_assoc[$i]['content'], 0, 10) . '...' ?></td>
                                                    <td class="am-text-middle am-hide-sm-only">
                                                        <a href="<?= $about_assoc[$i]['url'] ?>"><?= '...' . mb_substr($about_assoc[$i]['url'], -10) ?></a>
                                                    </td>
                                                    <td class="am-text-middle am-hide-sm-only"><?= $about_assoc[$i]['author'] ?></td>
                                                    <td class="am-text-middle am-hide-sm-only"><?= date('Y年m月d日 H:i:s', $about_assoc[$i]['time']) ?></td>

                                                    <td class="am-text-middle">
                                                        <div class="tpl-table-black-operation">
                                                            <a href="javascript:;">
                                                                <i class="am-icon-pencil"></i> 编辑
                                                            </a>
                                                            <a href="javascript:;"
                                                               class="tpl-table-black-operation-del">
                                                                <i class="am-icon-trash"></i> 删除
                                                            </a>
                                                        </div>
                                                    </td>
                                                </tr>
                                                <?php
                                            } else {
                                                ?>
                                                <tr class="even gradeC">
                                                    <td class="am-text-middle">
                                                        <input type="checkbox">
                                                    </td>
                                                    <td class="am-text-middle am-hide-sm-only"><?= $about_assoc[$i]['id'] ?></td>
                                                    <td class="am-text-middle">
                                                        <img src="<?= $about_assoc[$i]['image'] ?>"
                                                             class="tpl-table-line-img"
                                                             alt="">
                                                    </td>
                                                    <td class="am-text-middle"><?= $about_assoc[$i]['title'] ?></td>
                                                    <td class="am-text-middle"><?= mb_substr($about_assoc[$i]['content'], 0, 10) . '...' ?></td>
                                                    <td class="am-text-middle am-hide-sm-only">
                                                        <a href="<?= $about_assoc[$i]['url'] ?>"><?=  '...' . mb_substr($about_assoc[$i]['url'], -10)?></a>
                                                    </td>
                                                    <td class="am-text-middle am-hide-sm-only"><?= $about_assoc[$i]['author'] ?></td>
                                                    <td class="am-text-middle am-hide-sm-only"><?= date('Y年m月d日 H:i:s', $about_assoc[$i]['time']) ?></td>

                                                    <td class="am-text-middle">
                                                        <div class="tpl-table-black-operation">
                                                            <a href="javascript:;">
                                                                <i class="am-icon-pencil"></i> 编辑
                                                            </a>
                                                            <a href="javascript:;"
                                                               class="tpl-table-black-operation-del">
                                                                <i class="am-icon-trash"></i> 删除
                                                            </a>
                                                        </div>
                                                    </td>
                                                </tr>
                                                <!-- more data -->
                                                <?php
                                            }
                                        }
                                        C:
                                        ?>
                                        </tbody>
                                    </table>
                                </div>
                                <div class="am-u-lg-12 am-cf">

                                    <div class="am-fr">
                                        <ul class="am-pagination tpl-pagination">
                                            <li class="am-disabled"><a href="#">«</a></li>
                                            <li class="am-active"><a href="#">1</a></li>
                                            <li><a href="#">2</a></li>
                                            <li><a href="#">3</a></li>
                                            <li><a href="#">4</a></li>
                                            <li><a href="#">5</a></li>
                                            <li><a href="#">»</a></li>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="am-u-sm-12 am-u-md-12 am-u-lg-6">
                        <div class="widget am-cf">
                            <div class="widget-head am-cf">
                                <div class="widget-title am-fl">为什么选择我们设置</div>
                                <div class="widget-function am-fr">
                                    <a href="javascript:;" id="index-auto-about" class="am-icon-cog"> AUTO SETTING</a>
                                </div>
                            </div>
                            <?php
                            $set_array = $ff->config_variable_get('./admin-core/config.php', 'index_about_set');
                            if ($set_array['status'] === 0) {
                                $set_assoc = $set_array['assoc'];
                            } else if ($set_array['status'] === 1) {
                                if ($set_array['error'] === 'empty') {
                                    $set_assoc = [
                                        'image_up' => '',
                                        'image_down' => '',
                                        'content' => ''
                                    ];
                                } else {
                                    echo $set_array['error'];
                                    return;
                                }
                            } else return;
                            ?>
                            <div class="widget-body am-fr">

                                <form class="am-form tpl-form-border-form">

                                    <div class="am-form-group">
                                        <label for="about-title" class="am-u-sm-12 am-form-label am-text-left">
                                            标题
                                            <span class="tpl-form-line-small-title">
                                                Title
                                            </span>
                                        </label>
                                        <div class="am-u-sm-12">
                                            <input type="text" class="tpl-form-input am-margin-top-xs" id="about-title"
                                                   placeholder="为什么选择我们" value="<?= $set_assoc['title'] ?>">
                                            <small>请填写标题。</small>
                                        </div>
                                    </div>

                                    <div class="am-form-group">
                                        <label for="about-up" class="am-u-sm-12 am-form-label  am-text-left">
                                            位于上面的图
                                            <span class="tpl-form-line-small-title">Image</span>
                                        </label>
                                        <div class="am-u-sm-12 am-margin-top-xs">
                                            <div class="am-form-group am-form-file">
                                                <div class="tpl-form-file-img">
                                                    <img id="about-up" src="<?= $set_assoc['image_up'] ?>" alt="">
                                                </div>
                                                <button id="button-about-up" type="button"
                                                        class="am-btn am-btn-danger am-btn-sm ">
                                                    <i class="am-icon-cloud-upload"></i> 添加位于上面的图
                                                </button>
                                                <div id="submit-about-up" action="./admin-upload.php" method="post"
                                                     enctype="multipart/form-data">
                                                    <input id="upload-image-up" name="about-up" type="file"
                                                           multiple="">
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="am-form-group">
                                        <label for="about-down" class="am-u-sm-12 am-form-label  am-text-left">
                                            位于下面的图
                                            <span class="tpl-form-line-small-title">Image</span>
                                        </label>
                                        <div class="am-u-sm-12 am-margin-top-xs">
                                            <div class="am-form-group am-form-file">
                                                <div class="tpl-form-file-img">
                                                    <img id="about-down" src="<?= $set_assoc['image_down'] ?>" alt="">
                                                </div>
                                                <button id="button-about-down" type="button"
                                                        class="am-btn am-btn-danger am-btn-sm ">
                                                    <i class="am-icon-cloud-upload"></i> 添加位于下面的图
                                                </button>
                                                <div id="submit-about-down" action="./admin-upload.php" method="post"
                                                     enctype="multipart/form-data">
                                                    <input id="upload-image-down" name="about-down" type="file"
                                                           multiple="">
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="am-form-group">
                                        <label for="about-content"
                                               class="am-u-sm-12 am-form-label  am-text-left">文章内容 <span
                                                    class="tpl-form-line-small-title">Content</span></label>
                                        <div class="am-u-sm-12 am-margin-top-xs">
                                            <textarea class="" rows="10" id="about-content"
                                                      placeholder="某某家具有限公司是某某家具公司成立于1998年，企业位于中国家具生产制造重镇——某某省某某市某某镇，是一家具有高度设计开发能力的现代化中型家具生产企业，拥有意大利最新先进生产线和一支强大的专业生产、技术队伍，出品的各类家具均采用上乘材料及精益求精生产流程，质量可靠。 公司拥有一支年轻的销售及设计开发团队，主要生产软体沙发、金属家具、木质家具等系列产品。秉承“追求创新、传承经典”的企业文化，凭借自身合资企业的独特优势。"><?= preg_replace('/<bn\/>/', "\n", preg_replace('/<br\/>/', "\r", $set_assoc['content'])) ?></textarea>
                                        </div>
                                    </div>

                                    <div class="am-form-group">
                                        <div class="am-u-sm-12 am-u-sm-push-12">
                                            <button type="button" id="submit-index-about-set"
                                                    class="am-btn am-btn-primary tpl-btn-bg-color-success ">提交
                                            </button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="row">
                    <div class="am-u-sm-12 am-u-md-12 am-u-lg-6">
                        <div class="widget am-cf">
                            <div class="widget-head am-cf">
                                <div class="widget-title  am-fl">首页展示页面设置（目前电脑版前10个，手机版前6个）</div>
                                <div class="widget-function am-fr">
                                    <a href="javascript:;" id="index-auto-show" class="am-icon-cog"> AUTO SETTING</a>
                                </div>
                            </div>
                            <div class="widget-body  am-fr">

                                <div class="am-u-sm-12 am-u-md-6 am-u-lg-6">
                                    <div class="am-form-group">
                                        <div class="am-btn-toolbar">
                                            <div class="am-btn-group am-btn-group-xs">
                                                <button type="button" class="am-btn am-btn-default am-btn-success"
                                                        onclick="window.location.href= './add-index-show.php'">
                                                    <span class="am-icon-plus"></span> 新增
                                                </button>
                                                <button type="button" class="am-btn am-btn-default am-btn-secondary">
                                                    <span class="am-icon-save"></span> 保存
                                                </button>
                                                <button type="button" class="am-btn am-btn-default am-btn-danger"><span
                                                            class="am-icon-trash-o"></span> 删除
                                                </button>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="am-u-sm-12 am-u-md-12 am-u-lg-6">
                                    <div class="am-input-group am-input-group-sm tpl-form-border-form cl-p">
                                        <input type="text" class="am-form-field ">
                                        <span class="am-input-group-btn">
            <button class="am-btn  am-btn-default am-btn-success tpl-table-list-field am-icon-search"
                    type="button"></button>
          </span>
                                    </div>
                                </div>

                                <div class="am-u-sm-12 widget-body  widget-body-lg am-fr">
                                    <table width="100%"
                                           class="am-table am-table-compact am-table-bordered am-table-radius am-table-striped tpl-table-black am-table-hover table-main"
                                           id="example-r">
                                        <thead>
                                        <tr>
                                            <th class="table-check"><input class="checkbox-all" type="checkbox"></th>
                                            <th class="table-id am-hide-sm-only">ID</th>
                                            <th class="table-img">图片</th>
                                            <th class="table-title">标题</th>
                                            <th class="table-alt am-hide-sm-only">说明</th>
                                            <th class="table-url">链接</th>
                                            <th class="table-author am-hide-sm-only">作者</th>
                                            <th class="table-date am-hide-sm-only">修改日期</th>
                                            <th class="table-set">操作</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <?php
                                        $about_res_array = $admin_sql->index_show_select(1, 10);
                                        if ($about_res_array['status'] === 1 || $about_res_array['num'] === 0) goto D;
                                        $about_assoc = $about_res_array['array'];
                                        for ($i = 0; $i < $about_res_array['num']; $i++) {
                                            if (($i + 1) % 2 == 1) {
                                                ?>
                                                <tr class="gradeX">
                                                    <td class="am-text-middle">
                                                        <input type="checkbox">
                                                    </td>
                                                    <td class="am-text-middle am-hide-sm-only"><?= $about_assoc[$i]['id'] ?></td>
                                                    <td class="am-text-middle">
                                                        <img src="<?= $about_assoc[$i]['image'] ?>"
                                                             class="tpl-table-line-img"
                                                             alt="<?= $about_assoc[$i]['alt'] ?>">
                                                    </td>
                                                    <td class="am-text-middle"><?= $about_assoc[$i]['title'] ?></td>
                                                    <td class="am-text-middle am-hide-sm-only"><?= mb_substr($about_assoc[$i]['alt'], 0, 5) . '...' ?></td>
                                                    <td class="am-text-middle">
                                                        <a href="<?= $about_assoc[$i]['url'] ?>"><?= '...'.mb_substr($about_assoc[$i]['url'], -5) ?></a>
                                                    </td>
                                                    <td class="am-text-middle am-hide-sm-only"><?= $about_assoc[$i]['author'] ?></td>
                                                    <td class="am-text-middle am-hide-sm-only"><?= date('Y年m月d日 H:i:s', $about_assoc[$i]['time']) ?></td>
                                                    <td class="am-text-middle">
                                                        <div class="tpl-table-black-operation">
                                                            <a href="javascript:;">
                                                                <i class="am-icon-pencil"></i> 编辑
                                                            </a>
                                                            <a href="javascript:;"
                                                               class="tpl-table-black-operation-del">
                                                                <i class="am-icon-trash"></i> 删除
                                                            </a>
                                                        </div>
                                                    </td>
                                                </tr>
                                                <?php
                                            } else {
                                                ?>
                                                <tr class="even gradeC">
                                                    <td class="am-text-middle">
                                                        <input type="checkbox">
                                                    </td>
                                                    <td class="am-text-middle am-hide-sm-only"><?= $about_assoc[$i]['id'] ?></td>
                                                    <td class="am-text-middle">
                                                        <img src="<?= $about_assoc[$i]['image'] ?>"
                                                             class="tpl-table-line-img"
                                                             alt="<?= $about_assoc[$i]['alt'] ?>">
                                                    </td>
                                                    <td class="am-text-middle"><?= $about_assoc[$i]['title'] ?></td>
                                                    <td class="am-text-middle am-hide-sm-only"><?= mb_substr($about_assoc[$i]['alt'], 0, 5) . '...' ?></td>
                                                    <td class="am-text-middle">
                                                        <a href="<?= $about_assoc[$i]['url'] ?>"><?= '...'.mb_substr($about_assoc[$i]['url'], -5) ?></a>
                                                    </td>
                                                    <td class="am-text-middle am-hide-sm-only"><?= $about_assoc[$i]['author'] ?></td>
                                                    <td class="am-text-middle am-hide-sm-only"><?= date('Y年m月d日 H:i:s', $about_assoc[$i]['time']) ?></td>
                                                    <td class="am-text-middle">
                                                        <div class="tpl-table-black-operation">
                                                            <a href="javascript:;">
                                                                <i class="am-icon-pencil"></i> 编辑
                                                            </a>
                                                            <a href="javascript:;"
                                                               class="tpl-table-black-operation-del">
                                                                <i class="am-icon-trash"></i> 删除
                                                            </a>
                                                        </div>
                                                    </td>
                                                </tr>
                                                <!-- more data -->
                                                <?php
                                            }
                                        }
                                        D:
                                        ?>
                                        </tbody>
                                    </table>
                                </div>
                                <div class="am-u-lg-12 am-cf">

                                    <div class="am-fr">
                                        <ul class="am-pagination tpl-pagination">
                                            <li class="am-disabled"><a href="#">«</a></li>
                                            <li class="am-active"><a href="#">1</a></li>
                                            <li><a href="#">2</a></li>
                                            <li><a href="#">3</a></li>
                                            <li><a href="#">4</a></li>
                                            <li><a href="#">5</a></li>
                                            <li><a href="#">»</a></li>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="am-u-sm-12 am-u-md-12 am-u-lg-6">
                        <div class="widget am-cf">
                            <div class="widget-head am-cf">
                                <div class="widget-title  am-fl">首页新闻预览（取前三）</div>
                                <div class="widget-function am-fr">
                                    <a href="javascript:;" id="index-auto-news" class="am-icon-cog"> AUTO SETTING</a>
                                </div>
                            </div>
                            <div class="widget-body  am-fr">

                                <div class="am-u-sm-12 am-u-md-6 am-u-lg-6">
                                    <div class="am-form-group">
                                        <div class="am-btn-toolbar">
                                            <div class="am-btn-group am-btn-group-xs">
                                                <button type="button" class="am-btn am-btn-default am-btn-success"
                                                        onclick="window.location.href= './add-index-news.php'">
                                                    <span class="am-icon-plus"></span> 新增
                                                </button>
                                                <button type="button" class="am-btn am-btn-default am-btn-secondary">
                                                    <span class="am-icon-save"></span> 保存
                                                </button>
                                                <button type="button" class="am-btn am-btn-default am-btn-danger"><span
                                                            class="am-icon-trash-o"></span> 删除
                                                </button>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="am-u-sm-12 am-u-md-12 am-u-lg-6">
                                    <div class="am-input-group am-input-group-sm tpl-form-border-form cl-p">
                                        <input type="text" class="am-form-field ">
                                        <span class="am-input-group-btn">
            <button class="am-btn  am-btn-default am-btn-success tpl-table-list-field am-icon-search"
                    type="button"></button>
          </span>
                                    </div>
                                </div>

                                <div class="am-u-sm-12 widget-body  widget-body-lg am-fr">
                                    <table width="100%"
                                           class="am-table am-table-compact am-table-bordered am-table-radius am-table-striped tpl-table-black am-table-hover table-main"
                                           id="example-r">
                                        <thead>
                                        <tr>
                                            <th class="table-check"><input class="checkbox-all" type="checkbox"></th>
                                            <th class="table-id am-hide-sm-only">ID</th>
                                            <th class="table-title">标题</th>
                                            <th class="table-img">图片</th>
                                            <th class="table-content am-hide-sm-only">文字内容</th>
                                            <th class="table-url">链接</th>
                                            <th class="table-author am-hide-sm-only">作者</th>
                                            <th class="table-date am-hide-sm-only">修改日期</th>
                                            <th class="table-set">操作</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <?php
                                        $about_res_array = $admin_sql->index_news_select(1, 10);
                                        if ($about_res_array['status'] === 1 || $about_res_array['num'] === 0) goto E;
                                        $about_assoc = $about_res_array['array'];
                                        for ($i = 0; $i < $about_res_array['num']; $i++) {
                                            if (($i + 1) % 2 == 1) {
                                                ?>
                                                <tr class="gradeX">
                                                    <td class="am-text-middle">
                                                        <input type="checkbox">
                                                    </td>
                                                    <td class="am-text-middle am-hide-sm-only"><?= $about_assoc[$i]['id'] ?></td>
                                                    <td class="am-text-middle"><?= $about_assoc[$i]['title'] ?></td>
                                                    <td class="am-text-middle">
                                                        <img src="<?= $about_assoc[$i]['image'] ?>"
                                                             class="tpl-table-line-img"
                                                             alt="<?= $about_assoc[$i]['alt'] ?>">
                                                    </td>
                                                    <td class="am-text-middle am-hide-sm-only"><?= mb_substr($about_assoc[$i]['content'], 0, 5) . '...' ?></td>
                                                    <td class="am-text-middle">
                                                        <a href="<?= $about_assoc[$i]['url'] ?>"><?= '...'.mb_substr($about_assoc[$i]['url'], -10) ?></a>
                                                    </td>
                                                    <td class="am-text-middle am-hide-sm-only"><?= $about_assoc[$i]['author'] ?></td>
                                                    <td class="am-text-middle am-hide-sm-only"><?= date('Y年m月d日 H:i:s', $about_assoc[$i]['time']) ?></td>
                                                    <td class="am-text-middle">
                                                        <div class="tpl-table-black-operation">
                                                            <a href="javascript:;">
                                                                <i class="am-icon-pencil"></i> 编辑
                                                            </a>
                                                            <a href="javascript:;"
                                                               class="tpl-table-black-operation-del">
                                                                <i class="am-icon-trash"></i> 删除
                                                            </a>
                                                        </div>
                                                    </td>
                                                </tr>
                                                <?php
                                            } else {
                                                ?>
                                                <tr class="even gradeC">
                                                    <td class="am-text-middle">
                                                        <input type="checkbox">
                                                    </td>
                                                    <td class="am-text-middle am-hide-sm-only"><?= $about_assoc[$i]['id'] ?></td>
                                                    <td class="am-text-middle"><?= $about_assoc[$i]['title'] ?></td>
                                                    <td class="am-text-middle">
                                                        <img src="<?= $about_assoc[$i]['image'] ?>"
                                                             class="tpl-table-line-img"
                                                             alt="<?= $about_assoc[$i]['alt'] ?>">
                                                    </td>
                                                    <td class="am-text-middle am-hide-sm-only"><?= mb_substr($about_assoc[$i]['content'], 0, 5) . '...' ?></td>
                                                    <td class="am-text-middle">
                                                        <a href="<?= $about_assoc[$i]['url'] ?>"><?= '...'.mb_substr($about_assoc[$i]['url'], -10) ?></a>
                                                    </td>
                                                    <td class="am-text-middle am-hide-sm-only"><?= $about_assoc[$i]['author'] ?></td>
                                                    <td class="am-text-middle am-hide-sm-only"><?= date('Y年m月d日 H:i:s', $about_assoc[$i]['time']) ?></td>
                                                    <td class="am-text-middle">
                                                        <div class="tpl-table-black-operation">
                                                            <a href="javascript:;">
                                                                <i class="am-icon-pencil"></i> 编辑
                                                            </a>
                                                            <a href="javascript:;"
                                                               class="tpl-table-black-operation-del">
                                                                <i class="am-icon-trash"></i> 删除
                                                            </a>
                                                        </div>
                                                    </td>
                                                </tr>
                                                <!-- more data -->
                                                <?php
                                            }
                                        }
                                        E:
                                        ?>
                                        </tbody>
                                    </table>
                                </div>
                                <div class="am-u-lg-12 am-cf">

                                    <div class="am-fr">
                                        <ul class="am-pagination tpl-pagination">
                                            <li class="am-disabled"><a href="#">«</a></li>
                                            <li class="am-active"><a href="#">1</a></li>
                                            <li><a href="#">2</a></li>
                                            <li><a href="#">3</a></li>
                                            <li><a href="#">4</a></li>
                                            <li><a href="#">5</a></li>
                                            <li><a href="#">»</a></li>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                </div>
            </div>
        </div>
    </div>

    </body>


<?php
require_once 'admin-footer.php';
